package cn.edu.wynu.operator;

public class OperatorDemo03 {
    public static void main(String[] args) {
        //掌握赋值运算符的使用
        int a = 10;
        int b = 20;
        a = a+b; // a = 30
        System.out.println(a);

        a += b; //等价于a=a+b=30+20=50；
        System.out.println(a);

        a -= 2;//等价于a=a-2
        System.out.println(a); //50-2=48

        a *= 2;//等价于a=a*2
        System.out.println(a); //48*2=96

        a /= 2;//等价于a=a/2
        System.out.println(a); //96/2=48

        a %= 2;//等价于a=a%2
        System.out.println(a); //48%2 = 0

    }
}
